<%@page import="com.baozun.util.StringUtil"%>
<%@page import="com.baozun.model.TUser"%>
<%@page import="com.baozun.util.CommonConst"%>
<%@page import="com.baozun.model.TContact"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Static &amp; Dynamic Tables" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

<!--[if IE 7]>
		  <link rel="stylesheet" href="../assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

<!-- page specific plugin styles -->

<link rel="stylesheet"
	href="../assets/css/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" href="../assets/css/chosen.css" />
<link rel="stylesheet" href="../assets/css/colorpicker.css" />

<!-- fonts -->

<link rel="stylesheet" href="../assets/css/font.css" />

<!-- ace styles -->

<link rel="stylesheet" href="../assets/css/ace.min.css" />
<link rel="stylesheet" href="../assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="../assets/css/ace-skins.min.css" />
<link rel="stylesheet" href="../css/style.css"/>
<style type="text/css">
html {
	width: 100%;
	height: 100%;
	background: #fff;
}

body {
	background: #fff;
}
.modal_box {
	width: 100%;
	height: auto;
	min-height: 260px;
	margin: 0 auto;
	padding: 20px 0 10px 0;
}
.modal_btn {
	margin-top: 20px;
}

.modal_btn a {
	margin: 0 10px;
}
</style>
</head>
<%
TUser user = (TUser)session.getAttribute(CommonConst.SESSION_USER);
TContact contact = (TContact)request.getAttribute(TContact.T_CONTACT);
%>
<body>
	<div class="row">
		<div class="col-xs-12">
			<form class="form-inline" id="edit_contact_form" name="edit_contact_form" method="post" target="detail">
				<input type="hidden" name="stContactId" id="stContactId" value="<%=contact.getStContactId() %>"/>
				<input type="hidden" name="stUserId" id="stUserId" value="<%=contact.getStUserId()%>"/>
				<input type="hidden" name="dtCreateTime" value="<%=StringUtil.param2Html(contact.getDtCreateTime(),"yyyy-MM-dd HH:mm:ss")%>"/>
				<div class="modal_box">
				<dl class="tc_text">
					<dt>姓名</dt>
					<dd><input type="text" class="text_sm" name="stContactName" id="stContactName" value="<%=StringUtil.param2Html(contact.getStContactName())%>"/></dd>
				</dl>
				<dl class="tc_text">
					<dt>单位(<font color="red">*</font>)</dt>
					<dd><input type="text" class="text_sm" name="stUnitName" id="stUnitName" value="<%=StringUtil.param2Html(contact.getStUnitName())%>"/></dd>
				</dl>
				<dl class="tc_text">
					<dt>单位号码</dt>
					<dd><input type="text" class="text_sm" name="stTelephone" id="stTelephone" value="<%=StringUtil.param2Html(contact.getStTelephone())%>"/></dd>
				</dl>
				<dl class="tc_text">
					<dt>手机号码</dt>
					<dd><input type="text" class="text_sm" name="stCellphone" id="stCellphone" value="<%=StringUtil.param2Html(contact.getStCellphone())%>"/></dd>
				</dl>
				<dl class="tc_text">
					<dt></dt>
					<dd><input type="checkbox" name="stIsOpen>" id="stIsOpen" value="<%=CommonConst.BOOLEAN_VALUE_TRUE_STR %>" <%if(CommonConst.BOOLEAN_VALUE_TRUE_STR.equals(contact.getStIsOpen())){%>checked<%}%>/>是否公开</dd>
				</dl>
				<dl class="tc_text">
					<dt></dt>
					<dd></dd>
				</dl>
				<p class="modal_btn">
					<a href="javascript:;" class="btn btn-primary btn_bs"
						onclick="saveContact()">保 存</a>
					<a href="javascript:closeWindow()" class="btn">取 消</a>
				</p>
			</div>
			</form>
			<!-- 关键点1 -->
		<iframe name="detail" style="width: 100%; height: 800; display: none"></iframe>
		</div>
	</div>
	<script src="../assets/js/jquery-2.0.3.min.js"></script>
	<script type="text/javascript" src="../js/artDialog/artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../js/artDialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../js/openDialog.js"></script>
	<script type="text/javascript" src="../js/openDialogcustom.js"></script>
	<script>
	function saveContact(){
		var stContactName = $("input[name='stContactName']").val();
		var stUnitName = $("input[name='stUnitName']").val();
		//如果姓名和单位都不为空，则可以提交
		if(stContactName != null && ""!=stContactName && stUnitName != null && ""!=stUnitName){
			document.edit_contact_form.action="contact_save.do";
			document.edit_contact_form.submit();
		}else{
			alert("*号为必填信息！");
		}
		
	}
	
	//提交返回操作
	function workLater() {
		closeWindow(); // 必须写在“art.dialog.opener.querypross();”之前
		art.dialog.opener.process();
	}
	</script>
</body>
</html>